using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ComputaGuru.SpEAd
{
    public partial class LabelSelector : Form
    {
        private List<LinkLabelState> checkedItems = new List<LinkLabelState>();

        internal List<LinkLabelState> CheckedItems
        {
            get { return checkedItems; }
            set { checkedItems = value; }
        }

        public LabelSelector()
        {
            InitializeComponent();
        }

        private void cancelButton_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Hide();
        }

        private void okButton_Click(object sender, EventArgs e)
        {
            foreach (LinkLabelState checkedItem in this.labelList.SelectedItems)
            {
                this.CheckedItems.Add(checkedItem);
            }

            this.DialogResult = DialogResult.OK;
            this.Hide();
        }

        private void LabelSelector_Load(object sender, EventArgs e)
        {
            this.labelList.Items.Add(new LinkLabelState(LinkLabelSymbol.SourceBottomLabel));
            this.labelList.Items.Add(new LinkLabelState(LinkLabelSymbol.SourceTopLabel));
            this.labelList.Items.Add(new LinkLabelState(LinkLabelSymbol.MiddleBottomLabel));
            this.labelList.Items.Add(new LinkLabelState(LinkLabelSymbol.MiddleTopLabel));
            this.labelList.Items.Add(new LinkLabelState(LinkLabelSymbol.TargetBottomLabel));
            this.labelList.Items.Add(new LinkLabelState(LinkLabelSymbol.TargetTopLabel));
            this.labelList.Items.Add(new LinkLabelState(LinkLabelSymbol.RealizedItemSource));
            this.labelList.Items.Add(new LinkLabelState(LinkLabelSymbol.RealizedItemTarget));
        }
    }
}